package com.ds.lens.data.vo;

import com.ds.lens.data.vo.enums.VoMessageEnum;
import lombok.Data;
import java.io.Serializable;

/**
 * Description
 *
 * @author nianjun
 * @create 2017-07-03 下午3:42
 **/
@Data
//@Deprecated
public class BaseOutVO implements Serializable {

    public static final BaseOutVO INSTANCE = new BaseOutVO();

    protected int code = 0;

    protected String message = "success";

    protected Object data;

    public static BaseOutVO withData(Object data) {
        BaseOutVO vo = new BaseOutVO();
        vo.setData(data);
        return vo;
    }

    public static BaseOutVO withMessageEnum(VoMessageEnum messageEnum) {
        BaseOutVO vo = new BaseOutVO();
        vo.setCode(messageEnum.getCode());
        vo.setMessage(messageEnum.getMessage());
        return vo;
    }

}
